<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div style="padding: 15px;" id="dom-win-ro-add">

<form class="layui-form" id="form-ro-module" lay-filter="form-ro-module">

<div style="overflow: auto;height:460px;">	
<c:forEach items="${MenuList }" var="main">
	
	<div style="padding-bottom:15px;">
	
		<i class="layui-icon layui-icon-set-fill"></i> ${main.menuName }
	
		<div class="layui-form-item" style="padding-left:20px;padding-top:5px;">
		 
		  <c:forEach items="${main.subMenuList }" var="sub">
		    
		    <div class="layui-input-inline" style="width: 130px;">
		      <input type="checkbox" name="m_ids" title="${sub.menuName }" value="${sub.menuId }" 
		      		lay-skin="primary" ${sub.menuCheck?"checked":"" } >
		    </div>
		    
		  </c:forEach>
		  
		  
		</div>
	
	</div>
	
</c:forEach>
</div>
   <div class="layui-form-item"   >
    
      <button class="layui-btn" id="bn-ro-set-module" >提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    
  </div>
	
	
	
</form>

</div>

<script type="text/javascript">

$('#bn-ro-set-module').click(function(){
	var mids=[];
	$('#form-ro-module :checkbox:checked').each(function(){
		mids.push(this.value);
	});

	console.log(mids);

	opr.ajaxWithConfirm({
		title: "您确实添加该角色权限吗?",						
		url : 'role/module/${ro_id}',//此处\${ro_id}	是el表达式，不是js代码，运行于服务器端。					
		method : 'put',	
		data:JSON.stringify(mids),
		contentType:'application/json;charset=UTF-8',
		layer:layer
	});
	
	return false;
});




</script>


